$(function () {
    showLine1()

    showBar()
    showBar2()
    showBarHook()
})

function showLine1() {
    var myChart = echarts.init(document.getElementById("line1"));
    var option = {
        toolbox: {
            top: '6%',
            right: '3%',
            iconStyle: {
                normal: {
                    color: '#BBF3FF'
                }
            },
            feature: {

                dataView: {
                    readOnly: true,
                    optionToContent: function (opt) {
                        // let axisData = opt.xAxis[0].data; //坐标数据
                        // let series = opt.series; //折线图数据
                        // let tdHeads = '<td  style="padding: 5px">时间</td>'; //表头
                        // let tdBodys = ''; //数据
                        // series.forEach(function(item) {
                        //     //组装表头
                        //     tdHeads += `<td style="padding: 5px">${item.name}</td>`;
                        // });
                        // let table = `<div style="width:100%;height:307px;overflow:auto;"><table border="1" style="width:100%;border-collapse:collapse;font-size:12px;text-align:center"><tbody><tr>${tdHeads} </tr>`;
                        // for (let i = 0, l = axisData.length; i < l; i++) {
                        //     for (let j = 0; j < series.length; j++) {
                        //         //组装表数据
                        //         tdBodys += `<td>${series[j].data[i]}</td>`;
                        //     }
                        //     table += `<tr><td style="padding: 5px">${axisData[i]}</td>${tdBodys}</tr>`;
                        //     tdBodys = '';
                        // }
                        // table += '</tbody></table></div>';
                        var axisData = opt.xAxis[0].data;
                        var series = opt.series;
                        var tdHeads = '<td  style="padding: 5px">时间</td>';
                        var tdBodys = '';
                        series.forEach(function (item) {
                            tdHeads += ("<td style=\"padding: 5px\">" + item.name + "</td>");
                        });
                        var table = ("<div style=\"width:100%;height:307px;overflow:auto;\"><table border=\"1\" style=\"width:100%;border-collapse:collapse;font-size:12px;text-align:center\"><tbody><tr>" + tdHeads + " </tr>");
                        for (var i = 0, l = axisData.length; i < l; i++) {
                            for (var j = 0; j < series.length; j++) {
                                tdBodys += ("<td>" + series[j].data[i] + "</td>");
                            }
                            table += ("<tr><td style=\"padding: 5px\">" + axisData[i] + "</td>" + tdBodys + "</tr>");
                            tdBodys = '';
                        }
                        table += '</tbody></table></div>';

                        return table;
                    },
                    lang: ['数据视图', '关闭', '']
                }
            }
        },
        legend: {
            top: '13%',
            x: 'center',

            data: [
                '餐饮服务',
                '食品生产',
                '食品流通',
                '药品生产',
                '药品流通',
                '医疗器械生产',
                '医疗器械经营',
                '医疗器械使用',
                '保健品生产',
                '化妆品生产',
                '其他'
            ],
            itemWidth: 14,
            itemHeight: 8,
            textStyle: {
                color: '#97B8C9',
                fontSize: 16
            }
        },
        tooltip: {
            trigger: 'axis',
            textStyle: {
                fontSize: 16
            }
        },
        grid: {
            top: '32%',
            left: '5%',
            right: '5%',
            bottom: '13%',
            containLabel: true
        },
        xAxis: {
            type: 'category',

            axisLine: {
                onZero: false,
                show: true,

                lineStyle: {
                    color: '#1178C9'
                }
            },
            axisLabel: {
                interval: 0,
                rotate: -45,
                textStyle: {
                    color: '#97B8C9',
                    fontSize: 16

                }

            },
            axisLine: {
                lineStyle: {
                    color: '#07274D'
                }
            },
            axisTick: {
                lineStyle: {
                    color: '#1178C9'
                }
            },
            splitLine: {
                lineStyle: {
                    color: '#07274D'
                }
            },
            data: [
                '2016-01',
                '2016-02',
                '2016-03',
                '2016-04',
                '2016-05',
                '2016-06',
                '2016-07',
                '2016-08',
                '2016-09',
                '2016-10',
                '2016-11',
                '2016-12'
            ]
        },
        yAxis: [

            {
                show: true,
                type: 'value',
                interval: 0,
                name: '单位：次',
                nameTextStyle: {
                    color: '#97B8C9',
                    fontSize: 16
                },
                splitLine: {
                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisLine: {
                    onZero: false,

                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisTick: {
                    lineStyle: {
                        color: '#1178C9'
                    }
                },
                axisLabel: {
                    textStyle: {
                        color: '#97B8C9',
                        fontSize: 16

                    },

                    formatter: '{value} '
                }
            }

        ],
        color: [
            '#F2E52C',
            '#FF8516',
            '#FF5403',
            '#FF0000',
            '#21FB30',
            '#4FE0FD',
            '#4FA7FD',
            '#3157EC',
            '#7630ED',
            '#DF31EB',
            '#CCCCCC'

        ],
        series: [{
            name: '餐饮服务',
            type: 'line',
            data: [
                1,
                12,
                12,
                15,
                13,
                12,
                12,
                15,
                13,
                12,
                15,
                13
            ]

        }, {
            name: '食品生产',
            type: 'line',
            data: [
                21,
                22,
                22,
                25,
                23,
                22,
                22,
                25,
                23,
                12,
                15,
                13
            ]

        }, {
            name: '食品流通',
            type: 'line',
            data: [
                1,
                22,
                3,
                52,
                3,
                22,
                2,
                5,
                3,
                12,
                15,
                13
            ]

        }, {
            name: '药品生产',
            type: 'line',
            data: [
                16,
                262,
                36,
                562,
                36,
                262,
                26,
                56,
                36,
                162,
                165,
                163
            ]

        }, {
            name: '药品流通',
            type: 'line',
            data: [
                15,
                252,
                35,
                552,
                35,
                252,
                25,
                55,
                35,
                152,
                155,
                153
            ]

        }, {
            name: '医疗器械生产',
            type: 'line',
            data: [
                13,
                232,
                33,
                532,
                33,
                232,
                23,
                35,
                33,
                132,
                135,
                133
            ]

        }, {
            name: '医疗器械经营',
            type: 'line',
            data: [
                13,
                232,
                33,
                532,
                33,
                232,
                23,
                35,
                33,
                132,
                135,
                133
            ]

        }, {
            name: '医疗器械使用',
            type: 'line',
            data: [
                13,
                232,
                33,
                532,
                33,
                232,
                23,
                35,
                33,
                132,
                135,
                133
            ]

        }, {
            name: '保健品生产',
            type: 'line',
            data: [
                12,
                222,
                32,
                522,
                32,
                222,
                22,
                52,
                32,
                122,
                125,
                123
            ]

        }, {
            name: '化妆品生产',
            type: 'line',
            data: [
                11,
                212,
                31,
                512,
                31,
                212,
                21,
                51,
                31,
                112,
                115,
                113
            ]

        }, {
            name: '其他',
            type: 'line',
            data: [
                11,
                212,
                31,
                512,
                31,
                212,
                21,
                51,
                31,
                112,
                115,
                113
            ]

        }]
    };

    myChart.setOption(option);

}

function showBar() {
    var myChart = echarts.init(document.getElementById('bar1'));
    var option = {
        toolbox: {
            top: '6%',
            right: '3%',
            iconStyle: {
                normal: {
                    color: '#BBF3FF'
                }
            },
            feature: {

                dataView: {
                    readOnly: true,
                    optionToContent: function (opt) {
                        // let axisData = opt.xAxis[0].data; //坐标数据
                        // let series = opt.series; //折线图数据
                        // let tdHeads = '<td  style="padding: 5px">时间</td>'; //表头
                        // let tdBodys = ''; //数据
                        // series.forEach(function(item) {
                        //     //组装表头
                        //     tdHeads += `<td style="padding: 5px">${item.name}</td>`;
                        // });
                        // let table = `<div style="width:100%;height:307px;overflow:auto;"><table border="1" style="width:100%;border-collapse:collapse;font-size:12px;text-align:center"><tbody><tr>${tdHeads} </tr>`;
                        // for (let i = 0, l = axisData.length; i < l; i++) {
                        //     for (let j = 0; j < series.length; j++) {
                        //         //组装表数据
                        //         tdBodys += `<td>${series[j].data[i]}</td>`;
                        //     }
                        //     table += `<tr><td style="padding: 5px">${axisData[i]}</td>${tdBodys}</tr>`;
                        //     tdBodys = '';
                        // }
                        // table += '</tbody></table></div>';
                        var axisData = opt.xAxis[0].data;
                        var series = opt.series;
                        var tdHeads = '<td  style="padding: 5px">时间</td>';
                        var tdBodys = '';
                        series.forEach(function (item) {
                            tdHeads += ("<td style=\"padding: 5px\">" + item.name + "</td>");
                        });
                        var table = ("<div style=\"width:100%;height:307px;overflow:auto;\"><table border=\"1\" style=\"width:100%;border-collapse:collapse;font-size:12px;text-align:center\"><tbody><tr>" + tdHeads + " </tr>");
                        for (var i = 0, l = axisData.length; i < l; i++) {
                            for (var j = 0; j < series.length; j++) {
                                tdBodys += ("<td>" + series[j].data[i] + "</td>");
                            }
                            table += ("<tr><td style=\"padding: 5px\">" + axisData[i] + "</td>" + tdBodys + "</tr>");
                            tdBodys = '';
                        }
                        table += '</tbody></table></div>';
                        return table;
                    }
                }
            }
        },
        legend: {
            show: true,
            top: '10%',
            // formatter: function(name) {
            //     console.log(name);
            // },
            data: [
                '市场主体数量', '检查次数', '基层站所数量'

            ],
            itemWidth: 14,
            itemHeight: 8,
            textStyle: {
                color: '#97B8C9',
                fontSize: 16
            }

        },
        tooltip: {
            trigger: 'axis',
            textStyle: {
                fontSize: 16
            }
        },
        grid: {
            top: '32%',
            left: '5%',
            right: '5%',
            bottom: '13%',
            containLabel: true
        },

        xAxis: {
            type: 'category',

            // boundaryGap: false,

            axisLine: {
                onZero: false,
                show: true,

                lineStyle: {
                    color: '#1178C9'
                }
            },
            axisLabel: {
                interval: 0,
                rotate: -45,
                textStyle: {
                    color: '#97B8C9',
                    fontSize: 16

                }

            },
            axisLine: {
                lineStyle: {
                    color: '#07274D'
                }
            },
            axisTick: {
                lineStyle: {
                    color: '#1178C9'
                }
            },
            splitLine: {
                lineStyle: {
                    color: '#07274D'
                }
            },
            data: [
                '东阳市',
                '义乌市',
                '兰溪市',
                '磐安县',
                '浦江县',
                '武义县',
                '婺城区',
                '金东区',
                '永康市',
                '直属分局',
                '开发区',
                '金华山'

            ]
        },
        yAxis: [

            {
                type: 'value',
                interval: 0,
                // name: '户数',
                nameTextStyle: {
                    color: '#FFFFFF',
                    fontSize: 16
                },
                splitLine: {
                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisLine: {
                    onZero: false,

                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisTick: {
                    lineStyle: {
                        color: '#1178C9'
                    }
                },
                axisLabel: {
                    textStyle: {
                        color: '#97B8C9',
                        fontSize: 16

                    },
                    formatter: '{value} '
                }
            }, {
                type: 'value',
                name: '',
                min: 0,
                max: 4000,
                splitNumber: 5,
                splitLine: {
                    show: false,
                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisLine: {
                    onZero: false,

                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisTick: {
                    lineStyle: {
                        color: '#1178C9'
                    }
                },
                axisLabel: {
                    textStyle: {
                        color: '#97B8C9',
                        fontSize: 16

                    },
                    formatter: '{value}'
                }
            }
        ],
        series: [{
            name: '基层站所数量',
            type: 'bar',
            barWidth: 30,
            itemStyle: {
                normal: {
                    color: '#7630ED'
                    //  function(value) {
                    //     var coloeList = [
                    //         '#7630ED',
                    //         '#EB3432',
                    //         '#3157EC',
                    //         '#F2E52C',
                    //         '#21FB30',
                    //         '#FF8516',
                    //         '#4FE0FD',
                    //         '#DF31EB',
                    //         '#A5D571',
                    //         '#7630ED',
                    //         '#DF31EB',
                    //         '#F80396'
                    //
                    //     ]
                    //     return coloeList[value.dataIndex]
                    //
                    // }
                }
            },
            data: [
                1,
                22,
                2,
                5,
                3,
                22,
                2,
                5,
                3,
                23,
                4,
                1

            ]

        }, {
            name: '市场主体数量',
            type: 'line',
            itemStyle: {
                normal: {
                    color: '#fff'
                }
            },
            data: [
                11,
                2,
                3,
                7,
                122,
                12,
                15,
                13,
                122,
                12,
                12,
                4
            ]

        }, {
            name: '检查次数',
            type: 'line',

            itemStyle: {
                normal: {
                    color: '#4BCEEC'
                }
            },
            data: [
                1,
                22,
                2,
                5,
                3,
                3,
                5,
                9,
                22,
                2,
                2,
                9
            ]

        }]
    };

    myChart.setOption(option);

}

function showBar2() {
    var myChart = echarts.init(document.getElementById('bar2'));
    var option = {
        toolbox: {
            top: '6%',
            right: '3%',
            iconStyle: {
                normal: {
                    color: '#BBF3FF'
                }
            },
            feature: {

                dataView: {
                    readOnly: true,
                    optionToContent: function (opt) {
                        // let axisData = opt.xAxis[0].data; //坐标数据
                        // let series = opt.series; //折线图数据
                        // let tdHeads = '<td  style="padding: 5px">时间</td>'; //表头
                        // let tdBodys = ''; //数据
                        // series.forEach(function(item) {
                        //     //组装表头
                        //     tdHeads += `<td style="padding: 5px">${item.name}</td>`;
                        // });
                        // let table = `<div style="width:100%;height:307px;overflow:auto;"><table border="1" style="width:100%;border-collapse:collapse;font-size:12px;text-align:center"><tbody><tr>${tdHeads} </tr>`;
                        // for (let i = 0, l = axisData.length; i < l; i++) {
                        //     for (let j = 0; j < series.length; j++) {
                        //         //组装表数据
                        //         tdBodys += `<td>${series[j].data[i]}</td>`;
                        //     }
                        //     table += `<tr><td style="padding: 5px">${axisData[i]}</td>${tdBodys}</tr>`;
                        //     tdBodys = '';
                        // }
                        // table += '</tbody></table></div>';
                        var axisData = opt.xAxis[0].data;
                        var series = opt.series;
                        var tdHeads = '<td  style="padding: 5px">时间</td>';
                        var tdBodys = '';
                        series.forEach(function (item) {
                            tdHeads += ("<td style=\"padding: 5px\">" + item.name + "</td>");
                        });
                        var table = ("<div style=\"width:100%;height:307px;overflow:auto;\"><table border=\"1\" style=\"width:100%;border-collapse:collapse;font-size:12px;text-align:center\"><tbody><tr>" + tdHeads + " </tr>");
                        for (var i = 0, l = axisData.length; i < l; i++) {
                            for (var j = 0; j < series.length; j++) {
                                tdBodys += ("<td>" + series[j].data[i] + "</td>");
                            }
                            table += ("<tr><td style=\"padding: 5px\">" + axisData[i] + "</td>" + tdBodys + "</tr>");
                            tdBodys = '';
                        }
                        table += '</tbody></table></div>';
                        return table;
                    }
                }
            }
        },
        legend: {
            show: true,
            top: '10%',
            left: '37%',
            // formatter: function(name) {
            //     console.log(name);
            // },
            data: [
                '企业总数', '应完成检查数', '已完成检查数', '完成率'

            ],
            itemWidth: 14,
            itemHeight: 8,
            textStyle: {
                color: '#97B8C9',
                fontSize: 16
            }
        },
        tooltip: {
            trigger: 'axis',
            formatter: function (params) {
                var str = '';

                $.each(params, function (index, el) {

                    if (!index) {
                        str += el.name + '<br/>' + '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + el.color + '"></span>' + el.seriesName + ' : ' + el.data + '<br/>';

                    } else if (index === params.length - 1) {
                        str += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + el.color + '"></span>' + el.seriesName + ' : ' + el.data + '%<br/>'

                    } else {
                        str += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + el.color + '"></span>' + el.seriesName + ' : ' + el.data + '<br/>'
                    }
                    // console.log(str);
                });
                return str
            },
            textStyle: {
                fontSize: 16
            }

        },
        grid: {
            top: '36%',
            left: '5%',
            right: '5%',
            bottom: '13%',
            containLabel: true
        },

        xAxis: {
            type: 'category',

            // boundaryGap: false,

            axisLine: {
                onZero: false,
                show: true,

                lineStyle: {
                    color: '#1178C9'
                }
            },
            axisLabel: {
                interval: 0,
                // rotate: -45,
                formatter: function (params) {

                    if (params.length > 4) {
                        var _name = params.substring(0, 4) + '\n' + params.substring(4, params.length);
                        return _name;
                    }
                    return params
                },
                textStyle: {
                    color: '#97B8C9',
                    fontSize: 16

                }

            },
            axisLine: {
                lineStyle: {
                    color: '#07274D'
                }
            },
            axisTick: {
                lineStyle: {
                    color: '#1178C9'
                }
            },
            splitLine: {
                lineStyle: {
                    color: '#07274D'
                }
            },
            data: [
                '餐饮服务',
                '食品生产',
                '食品流通',
                '药品生产',
                '药品流通',
                '医疗器械生产',
                '医疗器械经营',
                '医疗器械使用',
                '保健品生产',
                '化妆品生产'

            ]
        },
        yAxis: [

            {
                type: 'value',

                interval: 0,
                // name: '户数',
                nameTextStyle: {
                    color: '#FFFFFF',
                    fontSize: 16
                },
                splitLine: {
                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisLine: {
                    onZero: false,

                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisTick: {
                    lineStyle: {
                        color: '#1178C9'
                    }
                },
                axisLabel: {
                    textStyle: {
                        color: '#97B8C9',
                        fontSize: 16

                    },
                    formatter: '{value} '
                }
            }, {
                type: 'value',
                name: '',
                min: 0,
                max: 100,
                splitNumber: 5,
                splitLine: {
                    show: false,
                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisLine: {
                    onZero: false,

                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisTick: {
                    lineStyle: {
                        color: '#1178C9'
                    }
                },
                axisLabel: {
                    textStyle: {
                        color: '#97B8C9',
                        fontSize: 16

                    },
                    formatter: '{value}%'
                }
            }
        ],
        series: [{
            name: '企业总数',
            type: 'bar',

            itemStyle: {
                normal: {
                    color: '#21FB30'
                    // color: function(value) {
                    //     var coloeList = [
                    //         '#7630ED',
                    //         '#EB3432',
                    //         '#3157EC',
                    //         '#F2E52C',
                    //         '#21FB30',
                    //         '#FF8516',
                    //         '#4FE0FD',
                    //         '#DF31EB',
                    //         '#A5D571'
                    //
                    //     ]
                    //     return coloeList[value.dataIndex]
                    //
                    // }
                }
            },
            data: [
                1,
                22,
                2,

                3,
                22,
                2,
                5,
                23,
                3,
                12
            ]

        }, {
            name: '应完成检查数',
            type: 'bar',
            itemStyle: {
                normal: {
                    color: '#EB3432'
                }
            },
            data: [
                11,
                122,
                12,

                13,
                122,
                12,
                12,
                1,
                43,
                23
            ]

        }, {
            name: '已完成检查数',
            type: 'bar',

            itemStyle: {
                normal: {
                    color: '#7630ED'
                }
            },
            data: [
                1,
                22,
                2,

                3,
                22,
                2,
                2,
                34,
                6,
                23
            ]

        }, {
            name: '完成率',
            type: 'line',
            yAxisIndex: 1,
            itemStyle: {
                normal: {
                    color: '#fff'
                }
            },
            data: [
                1,
                22,
                2,
                5,
                3,
                22,
                2,

                23,
                23,
                45
            ]

        }]
    };

    myChart.setOption(option);

}

function showBarHook() {
    var myChart = echarts.init(document.getElementById('bar-hook'));
    var option = {
        toolbox: {
            top: '6%',
            right: '3%',
            iconStyle: {
                normal: {
                    color: '#BBF3FF'
                }
            },
            feature: {

                dataView: {
                    readOnly: true,
                    optionToContent: function (opt) {
                        // let axisData = opt.xAxis[0].data; //坐标数据
                        // let series = opt.series; //折线图数据
                        // let tdHeads = '<td  style="padding: 5px">时间</td>'; //表头
                        // let tdBodys = ''; //数据
                        // series.forEach(function(item) {
                        //     //组装表头
                        //     tdHeads += `<td style="padding: 5px">${item.name}</td>`;
                        // });
                        // let table = `<div style="width:100%;height:307px;overflow:auto;"><table border="1" style="width:100%;border-collapse:collapse;font-size:12px;text-align:center"><tbody><tr>${tdHeads} </tr>`;
                        // for (let i = 0, l = axisData.length; i < l; i++) {
                        //     for (let j = 0; j < series.length; j++) {
                        //         //组装表数据
                        //         tdBodys += `<td>${series[j].data[i]}</td>`;
                        //     }
                        //     table += `<tr><td style="padding: 5px">${axisData[i]}</td>${tdBodys}</tr>`;
                        //     tdBodys = '';
                        // }
                        // table += '</tbody></table></div>';
                        var axisData = opt.xAxis[0].data;
                        var series = opt.series;
                        var tdHeads = '<td  style="padding: 5px">时间</td>';
                        var tdBodys = '';
                        series.forEach(function (item) {
                            tdHeads += ("<td style=\"padding: 5px\">" + item.name + "</td>");
                        });
                        var table = ("<div style=\"width:100%;height:307px;overflow:auto;\"><table border=\"1\" style=\"width:100%;border-collapse:collapse;font-size:12px;text-align:center\"><tbody><tr>" + tdHeads + " </tr>");
                        for (var i = 0, l = axisData.length; i < l; i++) {
                            for (var j = 0; j < series.length; j++) {
                                tdBodys += ("<td>" + series[j].data[i] + "</td>");
                            }
                            table += ("<tr><td style=\"padding: 5px\">" + axisData[i] + "</td>" + tdBodys + "</tr>");
                            tdBodys = '';
                        }
                        table += '</tbody></table></div>';
                        return table;
                    }
                }
            }
        },
        legend: {
            show: true,
            top: '13%',
            left: '36%', // formatter: function(name) {
            //     console.log(name);
            // },
            data: [
                '符合', '基本符合', '不符合', '检查结果占比'

            ],
            itemWidth: 14,
            itemHeight: 8,
            textStyle: {
                color: '#97B8C9',
                fontSize: 16
            }
        },
        tooltip: {
            trigger: 'axis',
            textStyle: {
                fontSize: 16
            },
            formatter: function (params) {
                var str = '';

                $.each(params, function (index, el) {

                    if (!index) {
                        str += el.name + '<br/>' + '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + el.color + '"></span>' + el.seriesName + ' : ' + el.data + '<br/>';

                    } else if (index === params.length - 1) {
                        str += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + el.color + '"></span>' + el.seriesName + ' : ' + el.data + '%<br/>'

                    } else {
                        str += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + el.color + '"></span>' + el.seriesName + ' : ' + el.data + '<br/>'
                    }
                    // console.log(str);
                });
                return str
            }
        },
        grid: {
            top: '32%',
            left: '5%',
            right: '5%',
            bottom: '13%',
            containLabel: true
        },
        xAxis: {
            type: 'category',

            // boundaryGap: false,

            axisLine: {
                onZero: false,
                show: true,

                lineStyle: {
                    color: '#1178C9'
                }
            },
            axisLabel: {
                interval: 0,
                // rotate: -45,
                formatter: function (params) {

                    if (params.length > 4) {
                        var _name = params.substring(0, 4) + '\n' + params.substring(4, params.length);
                        return _name;
                    }
                    return params
                },
                textStyle: {
                    color: '#97B8C9',
                    fontSize: 16

                }

            },
            axisLine: {
                lineStyle: {
                    color: '#07274D'
                }
            },
            axisTick: {
                lineStyle: {
                    color: '#1178C9'
                }
            },
            splitLine: {
                lineStyle: {
                    color: '#07274D'
                }
            },
            data: [
                '餐饮服务',
                '食品生产',
                '食品流通',
                '药品生产',
                '药品流通',
                '医疗器械生产',
                '医疗器械经营',
                '医疗器械使用',
                '保健品生产',
                '化妆品生产'

            ]
        },
        yAxis: [

            {
                type: 'value',
                interval: 0,
                // name: '户数',
                nameTextStyle: {
                    color: '#FFFFFF',
                    fontSize: 16
                },
                splitLine: {
                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisLine: {
                    onZero: false,

                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisTick: {
                    lineStyle: {
                        color: '#1178C9'
                    }
                },
                axisLabel: {
                    textStyle: {
                        color: '#97B8C9',
                        fontSize: 16

                    },
                    formatter: '{value} '
                }
            }, {
                type: 'value',
                name: '',
                min: 0,
                max: 100,
                splitNumber: 5,
                splitLine: {
                    show: false,
                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisLine: {
                    onZero: false,

                    lineStyle: {
                        color: '#07274D'
                    }
                },
                axisTick: {
                    lineStyle: {
                        color: '#1178C9'
                    }
                },
                axisLabel: {
                    textStyle: {
                        color: '#97B8C9',
                        fontSize: 16

                    },
                    formatter: '{value}%'
                }
            }
        ],
        series: [{
            name: '符合',
            type: 'bar',

            itemStyle: {
                normal: {
                    color: '#21FB30'
                    // color: function(value) {
                    //     var coloeList = [
                    //         '#7630ED',
                    //         '#EB3432',
                    //         '#3157EC',
                    //         '#F2E52C',
                    //         '#21FB30',
                    //         '#FF8516',
                    //         '#4FE0FD',
                    //         '#DF31EB',
                    //         '#A5D571'
                    //
                    //     ]
                    //     return coloeList[value.dataIndex]
                    //
                    // }
                }
            },
            data: [
                1,
                22,
                2,
                5,
                3,
                22,
                2,
                5,
                23,
                4
            ]

        }, {
            name: '基本符合',
            type: 'bar',
            itemStyle: {
                normal: {
                    color: '#269BFF'
                }
            },
            data: [
                11,
                122,
                12,
                15,
                13,
                122,
                12,
                12,
                2,
                5
            ]

        }, {
            name: '不符合',
            type: 'bar',

            itemStyle: {
                normal: {
                    color: '#EB3432'
                }
            },
            data: [
                1,
                22,
                2,
                5,
                3,
                22,
                2,
                2,
                3,
                4
            ]

        }, {
            name: '检查结果占比',
            type: 'line',
            yAxisIndex: 1,
            itemStyle: {
                normal: {
                    color: '#fff'
                }
            },
            data: [
                1,
                22,
                2,
                5,
                3,
                22,
                2,
                2,
                23,
                4
            ]

        }]
    };

    myChart.setOption(option);

}